<?php
/**
 * @package    Joomla.Tutorials
 * @subpackage Components
 * @link http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1
 * @license    GNU/GPL
 * TODO
 * datetime not working
*/
 
 
 
// no direct access
 
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.filesystem.path' );
jimport( 'joomla.application.component.view');
jimport( 'joomla.database.database' );





 

/**
 * HTML View class for the HelloWorld Component
 *
 * @package    HelloWorld
 */
 

class wotclanViewaddtitle extends JView
{
    function display($tpl = null)
    {
    	if (JFactory::getUser()->authorise('core.add', 'com_wotclan')) 
      {
      	include JPATH_COMPONENT.DS.'functions.php';
        $db =& JFactory::getDbo();
        $greeting = "Uploader votre replay! (V0.0.1)";
        $this->assignRef( 'greeting', $greeting );
        
        // get user info
        
    		$user =& JFactory::getUser();
				$usr_id = $user->get('id');
				
      
        parent::display($tpl);
				
				
					
				$query = $db->getQuery(true);
				$query="UPDATE `#__wotclan_replays` SET `title`='".$_POST["title"]."' WHERE uniqid='".$_GET["replayid"]."'";
				echo "<h1>$query</h1>";
				$db->setQuery($query);
				$db->query();
        
    	} else {
    		$greeting = "Vous n'avez pas acces a cette section!";
        $this->assignRef( 'greeting', $greeting );
 
        parent::display($tpl);
    		
    	}
    }
	
}




